<?php defined('BASEPATH') || exit('No direct script access allowed');
/**
 * Bonfire
 *
 * An open source project to allow developers to jumpstart their development of
 * CodeIgniter applications.
 *
 * @package   Bonfire
 * @author    Bonfire Dev Team
 * @copyright Copyright (c) 2011 - 2014, Bonfire Dev Team
 * @license   http://opensource.org/licenses/MIT
 * @link      http://cibonfire.com
 * @since     Version 1.0
 * @filesource
 */

/**
 * MY_Model extends BF_Model for backwards compatibility, and to provide a
 * placeholder class that your project can customize/extend as needed.
 *
 * @package    Bonfire\Core\MY_Model
 * @author     Lonnie Ezell
 * @link       http://cibonfire.com/docs/developer/bonfire_models
 */
class MY_Model extends BF_Model
{

	/**
     * Constructor
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }
    /**
     * [selectAll 根据条件查询符合的数据和数量]
     * @author [author]
     * @DateTime 2017-01-04T15:10:15+0800
     * @param    [string or Array]       $where  [查询条件]
     * @param    [Int]                   $limit  [每页数目]
     * @param    [Int]                   $offset [偏移量]
     * @return   [Array]                         [返回的数据]
     */
	public function selectAll( $where , $limit, $offset){

		$this->db->where( $where )->limit($limit, $offset);
        $arr =  parent::find_all();
        $num =  parent::count_all();
        return ['lists'=>$arr, 'count'=>$num];
	}
}
/* End of file ./application/core/MY_Model.php */